package controller

import (
	"sync_image/tools"

	"github.com/kataras/iris/v12"
)

func LogList(ctx iris.Context) {

	// books := []Image{
	// 	{Uri: "Mastering Concurrency in Go"},
	// 	{Uri: "Go Design Patterns"},
	// 	{Uri: "Black Hat Go"},
	// }

	// _ = books
	// rtn 翻转 array
	var rtn = []tools.LastInfo{}
	for i := len(tools.Last_info) - 1; i >= 0; i-- {
		rtn = append(rtn, tools.Last_info[i])
	}

	ctx.JSON(rtn)
	// TIP: negotiate the response between server's prioritizes
	// and client's requirements, instead of ctx.JSON:
	// ctx.Negotiation().JSON().MsgPack().Protobuf()
	// ctx.Negotiate(books)
}
